package com.xiaoxu.maxTemp;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class MaxTemperaturePartitioner extends Partitioner<Text, IntWritable> {


    @Override
    public int getPartition(Text text, IntWritable intWritable, int numPartitions) {
        if ("1949".equals(text.toString())){
            return 0;
        }else if ("1950".equals(text.toString())){
            return 1;
        }else if ("1951".equals(text.toString())){
            return 2;
        }else {
            return 3;
        }

    }
}
